package com.tengju.user.infrastructure.repository.star.convert;

import com.tengju.user.domain.model.star.StarUserFeature;
import com.tengju.user.domain.model.user.StarLevelEnum;
import com.tengju.user.domain.model.user.UserIdCode;
import com.tengju.user.infrastructure.persistence.mybatis.dataobject.StarUserFeatureDO;

/**
 * @author chenhang
 * @Date 2021/1/22
 */
public class StarFeatureConvert {

    public static StarUserFeature convertToModel(StarUserFeatureDO starUserFeatureDO) {
        return new StarUserFeature(
                UserIdCode.of(starUserFeatureDO.getIdCode()),
                StarLevelEnum.parseByCode(starUserFeatureDO.getStarLevel()),
                StarLevelEnum.parseByCode(starUserFeatureDO.getInviteStarLevel()),
                starUserFeatureDO.getTag()
                );
    }
}
